package cn.hunqing.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.hunqing.web.param.WeChatParameters;
import cn.hunqing.web.util.PathConstants;
import cn.hunqing.web.util.ViewConstants;

@Controller
@RequestMapping(PathConstants.PATH_WECHAT_SHARE)
public class WeChatShareController {
	private static Logger logger = LoggerFactory.getLogger(WeChatShareController.class);
	
	
	@RequestMapping(value = "/{weddingInvitationId}/{version}",method=RequestMethod.GET)
	public String doGetWeddingInvitation(HttpServletRequest request, HttpSession httpSession, @PathVariable String weddingInvitationId, @PathVariable String version,ModelMap model) {
		logger.info("Get the wechat share request,weddingInvitationId:{}",weddingInvitationId);
		model.addAttribute(WeChatParameters.RESPONSE_INVITATION, weddingInvitationId);
		return ViewConstants.VIEW_WECHAT_SHARE;
	}

}
